/**
 ******************************************************************************
 * @file    ts32fx_tk_cfg.h
 * @author  TOPSYS Application Team
 * @version V1.0.0
 * @brief   This file contains all the touchkey cfg functions.
 ******************************************************************************
 * @attention
 * 
 * <h2><center>&copy; COPYRIGHT 2018 TOPSYS</center></h2>
 *
 *
 */
/* Define to prevent recursive inclusion -------------------------------------*/


#ifndef __TS32FX_TK_CFG_H__
#define __TS32FX_TK_CFG_H__
#ifdef __cplusplus
extern "C" {
#endif

/************************************************/
#define TK_LED_BOTH_HW_AUTO_SCAN          1

#define TK_BIT_ENABLE          0x8000F 
#define TK_ENABLE_NUM          5

    
/* 
 * TK  Charge CAP Mode Config
 */ 
#define TK_CCVRS                 0
#define TK_FSDIV                 9
#define TK_DISCHARGE_TIME        11
#define TK_CHSWUP_SPEED          0
#define TK_CHSWUP                0


#define CC_PRECYC_NUM            1
#define CC_PER_SAMPLE_CLK        0
#define CC_PERIOD_SAMPLE_NUM     3


/* 
 * TK Hardware filter parameter
 * TK_FILTMODE should smaller than TK_BFLTMODE
 */ 
#define TK_FILTMODE     2
#define TK_BFLTMODE     4
#define TK_MMFLTMODE    1
#define TK_DBLEVEL      3


/*
 * TK Offset Setting
 */ 
#define TK_PA11_OFFSET_HW       24  //TK0
#define TK_PA10_OFFSET_HW       24  //TK1
#define TK_PA9_OFFSET_HW        20  //TK2
#define TK_PA8_OFFSET_HW        21  //TK3
#define TK_PA7_OFFSET_HW        22  //TK4
#define TK_PA6_OFFSET_HW        17  //TK5
#define TK_PA5_OFFSET_HW        19  //TK6
#define TK_PA4_OFFSET_HW        10  //TK7
#define TK_PA3_OFFSET_HW        35  //TK8
#define TK_PA2_OFFSET_HW        10  //TK9
#define TK_PA1_OFFSET_HW        10  //TK10
#define TK_PA0_OFFSET_HW        10  //TK11
#define TK_PB7_OFFSET_HW        10  //TK12
#define TK_PB6_OFFSET_HW        10  //TK13
#define TK_PB5_OFFSET_HW        10  //TK14
#define TK_PB4_OFFSET_HW        10  //TK15
#define TK_PB3_OFFSET_HW        10  //TK16
#define TK_PB2_OFFSET_HW        10  //TK17
#define TK_PB1_OFFSET_HW        10  //TK18
#define TK_PB0_OFFSET_HW        26  //TK19


#define TK_PA11_OFFSET_SW       28  //TK0
#define TK_PA10_OFFSET_SW       28  //TK1
#define TK_PA9_OFFSET_SW        24  //TK2
#define TK_PA8_OFFSET_SW        25  //TK3
#define TK_PA7_OFFSET_SW        33  //TK4
#define TK_PA6_OFFSET_SW        26  //TK5
#define TK_PA5_OFFSET_SW        29  //TK6
#define TK_PA4_OFFSET_SW        10  //TK7
#define TK_PA3_OFFSET_SW        52  //TK8
#define TK_PA2_OFFSET_SW        10  //TK9
#define TK_PA1_OFFSET_SW        10  //TK10
#define TK_PA0_OFFSET_SW        10  //TK11
#define TK_PB7_OFFSET_SW        10  //TK12
#define TK_PB6_OFFSET_SW        10  //TK13
#define TK_PB5_OFFSET_SW        10  //TK14
#define TK_PB4_OFFSET_SW        10  //TK15
#define TK_PB3_OFFSET_SW        10  //TK16
#define TK_PB2_OFFSET_SW        10  //TK17
#define TK_PB1_OFFSET_SW        10  //TK18
#define TK_PB0_OFFSET_SW        33  //TK19


#ifdef __cplusplus
}
#endif

#endif //__TS32FX_TK_CFG_H
